<table width="100%" cellpadding="0" cellspacing="0" border="0">
    <thead>
        <tr>
            {if $arrResult && isset($smarty.session.product) && ( (($smarty.session.product&1<<3)>0) || (($smarty.session.product&1<<4)>0) )}
                <th class="firstChild" width="30"><input type="checkbox" name="pcheckall" id="pcheckall" onclick="javascript:checkAll(this.form,'pcategoryid[]',this.checked);"/></th>
                <th>Tên</th>
            {else}
           		<th class="firstChild">Tên</th>
            {/if}     
            <th width="80">Tình trạng</th>                                
            <th width="120">Trình tự hiển thị</th>
            {if $arrResult && isset($smarty.session.product)}
                <th width="76">&nbsp;</th>
            {/if}
        </tr>
    </thead>
    <tbody>
        {if $arrResult}
            {foreach item=item from=$arrResult}
                <tr class="{cycle values="odd,even"}">
                    {if isset($smarty.session.product) && ((($smarty.session.product&1<<3)>0) || (($smarty.session.product&1<<4)>0))}
                        <td class="firstChild" align="center">
                        	<input type="checkbox" id="pcategoryid{$item.categoryid}" name="pcategoryid[]" value="{$item.categoryid}" onclick="javascript:checkOneItem(this.form, 'pcheckall')"/>
                        </td>
                        <td>{$item.name} </td>
                    {else}
                        <td class="firstChild">{$item.name} </td>
                    {/if}
                    <td align="center">
                    	{if $item.status == 0}
                        	<img src="{$smarty.const.HOST_STATICS}img/icon/ad-unaccept.png" width="16" height="16" alt="" border="0" title="Đang tạm dừng" />
                        {elseif $item.status == 1}
                            <img src="{$smarty.const.HOST_STATICS}img/icon/ad-accept.png" alt="" border="0" width="16" height="16" title="Đang thực thi" />
                        {else}
                            <img src="{$smarty.const.HOST_STATICS}img/icon/ad-delete.png" width="16" height="16" alt="" border="0" title="Bị xóa" />
                        {/if}
                    </td>
                    <td align="right">{$item.disorder}</td>
                    <td align="center">
                        {if isset($smarty.session.product)}
                        	{if $item.parentid==0}
                                <a href="{$smarty.const.HOST_BACKEND}category/index?parentid={$item.categoryid}&amp;name={$item.name|escape}" title="Xem danh sách mục con">
                                    <img src="{$smarty.const.HOST_STATICS}img/icon/ad-list.png" alt="List" border="0" width="16" height="16" />
                                </a>
                            {/if}
                        	{if isset($smarty.session.product) && ($smarty.session.product&1<<1) > 0 && $item.parentid==0}
                            	<a href="{$smarty.const.HOST_BACKEND}category/add?parentid={$item.categoryid}" title="Thêm danh mục con">
                                    <img src="{$smarty.const.HOST_STATICS}img/icon/ad-add.png" alt="Add" border="0" width="16" height="16" />
                                </a>
                            {/if}
                            {if ($smarty.session.product&1<<2)>0}
                                <a href="{$smarty.const.HOST_BACKEND}category/edit?categoryid={$item.categoryid}" title="Cập nhật thông tin">
                                    <img src="{$smarty.const.HOST_STATICS}img/icon/ad-edit.png" alt="Edit" border="0" width="16" height="16" />
                                </a>
                            {/if}
                        {else}
                            &nbsp;
                        {/if}
                    </td>
                </tr>
            {/foreach}
        {else}
        	<tr><td colspan="2" align="center">Không có dữ liệu</td></tr>
        {/if}
    </tbody>
</table>